public class News {
public Account account{get; private set;}
public news() {
Id id=ApexPages.currentPage().getParameters().get('id');
 account=(id==null)?new account():
[SELECT name, phone, industry FROM account WHERE id=:id];
}
public PageReference save() {
try{
upsert(account);
}
catch(System.DMLException e) {
ApexPages.addMessages(e);
return null;
}

return(new Apexpages.standardController(account)).view();
}
}